package com.centit.flowNode.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
@Entity
@Table(name = "T_FLOW_NODE")
public class FlowNode implements java.io.Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * REC_ID 主键 
	 */
	@Id
	@Column(name = "REC_ID")
	
	private String recId;
	
	/**
	 * FLOW_REC_ID 流程code 
	 */
	@Column(name = "FLOW_REC_ID")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String flowRecId;
	
	/**
	 * IDEA_REC_ID 日志code 
	 */
	@Column(name = "IDEA_REC_ID")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String ideaRecId;
	
	/**
	 * NODE_NAME 标题 
	 */
	@Column(name = "NODE_NAME")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String nodeName;
	
	/**
	 * NODE_NUM 标题 
	 */
	@Column(name = "NODE_NUM")
	private Integer nodeNum;
	/**
	 * NEXT_USER_CODE 下一个办理人 
	 */
	@Column(name = "NEXT_USER_CODE")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String nextUserCode;
	/**
	 * NEXT_USER_UNIT 下一个办理部门 
	 */
	@Column(name = "NEXT_USER_UNIT")
	@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
	private String nextUserUnit;
	/**
	 * NEXT_TYPE 下一个办理方式 
	 */
	@Column(name = "NEXT_TYPE")
	@Length(min = 0, max = 1, message = "字段长度不能小于{min}大于{max}")
	private String nextType;
	/**
	 * STATUS 节点状态
	 */
	@Column(name = "STATUS")
	@Length(min = 0, max = 1, message = "字段长度不能小于{min}大于{max}")
	private String status;
	
	
	
	public FlowNode() {}
	public FlowNode(String recId) {
		this.recId=recId;
	}
	public FlowNode(String recId, @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}") String flowRecId,
			@Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}") String ideaRecId,
			@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}") String nodeName, Integer nodeNum,String nextUserCode,String nextUserUnit,String nextType,String status) {
		super();
		this.recId = recId;
		this.flowRecId = flowRecId;
		this.ideaRecId = ideaRecId;
		this.nodeName = nodeName;
		this.nodeNum = nodeNum;
		this.nextType=nextType;
		this.nextUserCode=nextUserCode;
		this.nextUserUnit=nextUserUnit;
		this.status=status;
	}
	public String getRecId() {
		return recId;
	}
	public void setRecId(String recId) {
		this.recId = recId;
	}
	public String getFlowRecId() {
		return flowRecId;
	}
	public void setFlowRecId(String flowRecId) {
		this.flowRecId = flowRecId;
	}
	public String getIdeaRecId() {
		return ideaRecId;
	}
	public void setIdeaRecId(String ideaRecId) {
		this.ideaRecId = ideaRecId;
	}
	public String getNodeName() {
		return nodeName;
	}
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}
	public Integer getNodeNum() {
		return nodeNum;
	}
	public void setNodeNum(Integer nodeNum) {
		this.nodeNum = nodeNum;
	}
	
	public String getNextUserCode() {
		return nextUserCode;
	}
	public void setNextUserCode(String nextUserCode) {
		this.nextUserCode = nextUserCode;
	}
	public String getNextUserUnit() {
		return nextUserUnit;
	}
	public void setNextUserUnit(String nextUserUnit) {
		this.nextUserUnit = nextUserUnit;
	}
	public String getNextType() {
		return nextType;
	}
	public void setNextType(String nextType) {
		this.nextType = nextType;
	}
	
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public FlowNode copy(FlowNode other){
		  
		this.setRecId(other.getRecId());
		this.flowRecId=other.getFlowRecId();
		this.ideaRecId=other.getIdeaRecId();
		this.nodeName=other.getNodeName();
		this.nodeNum=other.getNodeNum();
		this.nextType=other.getNextType();
		this.nextUserCode=other.getNextUserCode();
		this.nextUserUnit=other.getNextUserUnit();
		this.status=other.getStatus();
		return this;
		
	}
	public FlowNode copyNotNullProperty(FlowNode other) {
		if( other.getRecId() != null){
			this.setRecId(other.getRecId());}
		if( other.getFlowRecId() != null){
			this.flowRecId= other.getFlowRecId();} 
		if( other.getIdeaRecId() != null){
			this.ideaRecId= other.getIdeaRecId();} 
		if( other.getNodeName() != null){
			this.nodeName= other.getNodeName();} 
		if( other.getNodeNum() != null){
			this.nodeNum= other.getNodeNum();}  
		if( other.getNextType() != null){
			this.nextType= other.getNextType();}  
		if( other.getNextUserCode() != null){
			this.nextUserCode= other.getNextUserCode();}  
		if( other.getNextUserUnit() != null){
			this.nextUserUnit= other.getNextUserUnit();}  
		if( other.getStatus() != null){
			this.status= other.getStatus();}  
		return this;
		
	}
	
	public FlowNode clearProperties() {
		this.flowRecId=null;
		this.ideaRecId=null;
		this.nodeName=null;
		this.nodeNum=null;
		this.nextType=null;
		this.nextUserCode=null;
		this.nextUserUnit=null;
		this.status=null;
		return this;
		
	}
	
}
